package com.zut.fitness.controller;

import com.zut.fitness.common.Result;
import com.zut.fitness.pojo.dto.LoginDto;
import com.zut.fitness.service.IFroUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/auth")
public class LoginController {

    @Autowired
    private IFroUserService froUserService;

    @PostMapping("/login")
    public Result login(@RequestBody LoginDto loginDto){
        return froUserService.login(loginDto);
    }

    @PostMapping("/register")
    public Result register(@RequestBody LoginDto loginDto){
        return froUserService.register(loginDto);
    }
}
